<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div class="parents">
        <div>哒哒1</div>
        <div>哒哒2</div>
        <div class="todel">哒哒2</div>
    </div>
    
    
    <script>
        let parents = document.querySelector('.parents');
        let del = document.querySelector('.todel');
        parents.onclick = function() {
            parents.removeChild(del);
        }
    </script>
</body>
</html>